<template>
  <el-dialog title="个人业绩" :visible.sync="showCustomerPerformanceDialog" center width="700px">
    <el-carousel indicator-position="outside" :autoplay="false" height="600px">
      <el-carousel-item>
        <div class="item">
          <h4>成交额: {{performanceData.total}}</h4>
          <h4>成交数: {{performanceData.num}}</h4>
          <h4>客户数: {{performanceData.people}}</h4>
        </div>
      </el-carousel-item>
    </el-carousel>
  </el-dialog>
</template>

<script>
  import {getCustomerPerformance} from '@/api/thk/performance'
  import store from '@/store'
  export default {
    name: 'customerPerformance',
    data(){
      return{
        showCustomerPerformanceDialog: false,
        performanceData: []
      }
    },


    methods:{
      showCustomerPerformance(customer_id){
        this.showCustomerPerformanceDialog = !this.showCustomerPerformanceDialog
        getCustomerPerformance(store.getters.token, {customer_id}).then(res => {
          this.performanceData = res.data.data
          console.log(">>>>>> performanceData >>>>>>>")
          console.log(this.performanceData)
        }).catch(err => {
          this.$message("获取个人业绩失败")
        })
      }
    }

  }
</script>

<style scoped>
  .item{
    text-align: center;
  }
</style>

